package com.me.study.designPatterns.Observer;

/**
 * 观察者模式：场景模拟，主人中午时间喂食
 *
 * @author ME
 * @date 2021/4/1
 */
public class TestObserver {

    public static void main(String[] args) {
        Cat cat1 = new Cat("波斯猫");
        Cat cat2 = new Cat("哆啦A梦");
        Cat cat3 = new Cat("黑猫警长");

        MasterPerson master = new MasterPerson("ljy");

        master.addObserver(cat1);
        master.addObserver(cat2);
        master.addObserver(cat3);

        master.feed("小鱼干");
    }

}
